<template>
  <div class="hello">
    <h1>{{ msg }}</h1>
    <ul>
      <li v-for="list in lists" :key="list.id">
        <router-link :to="'/item?id='+list.id">
        <img style="width:200px" :src="'http://39.107.239.131/Tencent/public/index.php/index/index/getThumb?thumb='+list.thumb" alt="">
        <p>{{list.name}}</p>
        </router-link>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  name: 'HelloWorld',
  data () {
    return {
      msg: '新闻列表',
      lists:[]
    }
  },
  mounted(){
    
    //列表
    this.$axios.get('http://39.107.239.131/Tencent/public/index.php/index/index/article')
    .then(res=>{
      console.log(res)
      this.lists = res.data.data
    })
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
li{
margin-bottom:100px;
}
</style>
